<template>
	<view class="flex-ju-c">
		
		<view class="width1000">
			<image mode="widthFix" class="image" :src="user_img?user_img:'/static/aaa.png'"></image>
			<view class="flex-ju-c mt50">
				<view @click="setimg" class="bg191919 wh400-75 flex-ju-c colorfff ra75">
					更换背景图片
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user_img:uni.getStorageSync('user').user_img,
			}
		},
		methods: {
			setimg(){
				this.upimg(1).then(res=>{
					this.http('/api/user/edit',{
						user_img:res[0]
					},'post').then(ress=>{
						this.user_img = res[0]
						var urd = uni.getStorageSync('user')
							urd.user_img = res[0]
						uni.setStorageSync('user',urd)
						
					})
				})
			}
			
		}
	}
</script>

<style>
page{
	background: #000000;
}
</style>
